<!DOCTYPE html>
<html lang="zh_CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <script src="https://cdn.bootcdn.net/ajax/libs/p5.js/1.3.1/p5.min.js"></script>
  <title>Title</title>
</head>
<body>
<script>
  var schnauzer;
  const p5 = new P5();

  function preload() {
    schnauzer = loadImage("../../love.png");
  }

  function setup() {
    createCanvas(1200, 600);
    background(120, 120, 255);
    // noLoop()
  }


  function draw() {
    clear()
    push()
    const _width = schnauzer.width * 1/2
    const _height = schnauzer.height * 1/2
    translate(400, 100);
    // rotate(radians(degrees));
    rotate(frameCount / -100.0);
    translate(-400, -100);
    image(schnauzer, 400-_width, 100-_height);
    pop()


    push()
    translate(200, 100);
    // rotate(radians(degrees));
    rotate(frameCount / -100.0);
    translate(-200, -100);
    image(schnauzer, 200-_width, 100-_height);
    pop()

  }

</script>
</body>
</html>
